#include <stdio.h>
#include <string.h>
#include <stdlib.h>

int main()
{
    char str[] = "0xff01";
    unsigned long num = strtoul(str, NULL, 16);
    printf("%lu\n", num); // 输出：65537

    char str2[] = "MemTotal:       32670756 kB";
    char* p = strchr(str2, ':') + 1;
    num = strtoul(p, NULL, 10);
    printf("%lu\n", num);

    return 0;
}